#ifndef YY_STDLIB_INCLUDE
#define YY_STDLIB_INCLUDE

#define HALF_MAX        65504.0 // (2 - 2^-10) * 2^15

struct VertexInputBase
{
	float4 vertex : POSITION;
	float2 uv : TEXCOORD0;
};

struct VertexOutputBase
{
	float2 texcoord : TEXCOORD0;
    float4 vertex : SV_POSITION;
};

// Vertex manipulation
float2 TransformTriangleVertexToUV(float2 vertex)
{
	float2 uv = (vertex + 1.0) * 0.5;
	return uv;

}

VertexOutputBase VertDefault(VertexInputBase v)
{
	VertexOutputBase o;
	o.vertex = float4(v.vertex.xy, 0.0, 1.0);
	o.texcoord = TransformTriangleVertexToUV(v.vertex.xy);

#if UNITY_UV_STARTS_AT_TOP
	o.texcoord = o.texcoord * float2(1.0, -1.0) + float2(0.0, 1.0);
#endif
	//o.uv = TRANSFORM_TEX(v.uv, _MainTex);
	//UNITY_TRANSFER_FOG(o,o.vertex);
	return o;
}

half4 SafeHDR(half4 c)
{
	return min(c, HALF_MAX);
}


#endif